package com.example.designpartten.proxy;

import lombok.extern.slf4j.Slf4j;

/**
 * @author hql
 * @date 2020/4/10 10:38
 */
@Slf4j
public class CaseProxy implements Case {

    private Case aCase = null;

    public CaseProxy() throws Exception {
        //声明自己代代理Case
        aCase = new CaseImpl(this);
    }

    @Override
    public void caseA() {
        this.test();
        this.aCase.caseA();

    }

    @Override
    public void caseB() {
        this.message();
        this.aCase.caseB();
    }

    public void message() {
        log.info("消息来源");
    }

    public void test() {
        log.info("测谎");
    }
}
